<template>
  <div class="goods-wrapper">
    <component :is="cmpName" @addGoods="handleAddGoods" @titleClick="handleTitleClick" @editGoods="handleEditGoods" />
  </div>
</template>
<script>
import Goods from './list/goods'
import Add from './list/add'
export default {
  data() {
    return {
      cmpName: Goods,
      classificationList: [],
      detailId: {}
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    handleAddGoods() {
      this.cmpName = Add
    },
    handleEditGoods() {
      this.cmpName = Add
    },
    handleTitleClick(index) {
      switch (index) {
        case 0:
          this.cmpName = Goods
          break
        case 1:
          this.cmpName = Add
      }
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
